//引入mysql模块
const mysql = require('mysql')
//通过构造器创建Router()对象
//let router=new Router();

//提供数据库连接对象
//数据库连接
const connection = mysql.createConnection({
  host: '127.0.0.1',
  user: 'root',
  password: 'rootroot',
  database: 'crdatabase',
  port: 3306,
  timezone: '08:00', //配置时区
})
connection.connect() //连接数据库

module.exports = connection
